package com.startit.validation;

import com.startit.csv.CSVField.ValidationType;
import com.startit.util.StringUtil;

public class MinValidation implements IValidation {
	public static final ValidationType name = ValidationType.MIN;

	private int min;

	public MinValidation(int min) {
		super();
		this.min = min;
	}

	public boolean valid(String v) {
		try {
			return StringUtil.isEmpty(v) || min <= (new Integer(v)).intValue();
		} catch (NumberFormatException e) {
			return false;
		}
	}

}
